<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<script src="js/jquery-1.8.0.js" ></script>
<title>管理导航区域</title>
</head>
<script type="text/javascript">
	var preClassName = "man_nav_1";
	
	//<li id="man_nav_2" onclick="list_sub_nav(id,'系统设置')" class="bg_image">系统设置</li>
	function initMenu(menu_id , menu_name){
		$("#navUl").append("<li id='"+menu_id+"' onclick='list_sub_nav(id)' class='bg_image'>"+menu_name+"</li>");
	}
	function list_sub_nav(Id, sortname) {
		if (preClassName != "") {
			getObject(preClassName).className = "bg_image";
		}
		if (getObject(Id).className == "bg_image") {
			getObject(Id).className = "bg_image_onclick";
			preClassName = Id;
			showInnerText(Id);
			window.top.frames['leftFrame'].outlookbar.getbytitle(sortname);
			window.top.frames['leftFrame'].outlookbar.getdefaultnav(sortname);
		}
	}

	function showInnerText(Id) {
		var switchId = parseInt(Id.substring(8));
		var showText = "对不起没有信息！";
		switch (switchId) {
		case 1:
			showText = "欢迎使用无忧易货网（www.51ehuo.cn）后台管理系统!";
			break;
		case 2:
			showText = "system setting!";
			break;
		case 3:
			showText = "User Manage";
			break;
		case 4:
			showText = "Chanage Manage";
			break;
		case 5:
			showText = "Ad AND news!";
			break;
		}
		getObject('show_text').innerHTML = showText;
	}
	//获取对象属性兼容方法
	function getObject(objectId) {
		if (document.getElementById && document.getElementById(objectId)) {
			// W3C DOM
			return document.getElementById(objectId);
		} else if (document.all && document.all(objectId)) {
			// MSIE 4 DOM
			return document.all(objectId);
		} else if (document.layers && document.layers[objectId]) {
			// NN 4 DOM.. note: this won't find nested layers
			return document.layers[objectId];
		} else {
			return false;
		}
	}
	
	$(document).ready(function(){

		//$("#navUl").append("<li id='d123' onclick='list_sub_nav(12,12)' class='bg_image_onclick'>adasda</li>");
		//$("<li id='d123' onclick='list_sub_nav(12,12)' class='bg_image_onclick'>adasda</li>").appendTo("#navUl");
		initMenu("m1001","testasdass");
	});
</script>
<body>
	<div id="nav">
		<ul id="navUl">
			<li id="man_nav_1" onclick="list_sub_nav(id,'管理首页')"
				class="bg_image_onclick">管理首页</li>
			<li id="man_nav_2" onclick="list_sub_nav(id,'系统设置')" class="bg_image">系统设置</li>
			<li id="man_nav_3" onclick="list_sub_nav(id,'账户管理')" class="bg_image">账户管理</li>
			<li id="man_nav_4" onclick="list_sub_nav(id,'易货管理')" class="bg_image">易货管理</li>
		</ul>
	</div>
	<div id="sub_info">
		&nbsp;&nbsp;<img src="images/hi.gif" />&nbsp;<span id="show_text">welcome to here!</span>
	</div>
</body>
</html>
